// Playground - noun: a place where people can play

/**
* 控制转移和二维数组
**/

import UIKit

//二维数组
var board = Array<Array<Int>>();
for i in 0...10
{
    board.append(Array(count:10,repeatedValue:0));
}

let randX = Int(arc4random()%10);
let randY = Int(arc4random()%10);

board[randX][randY] = 1;
board;
var i = 0, j = 0;
mainloop:for i = 0; i < 10; i++
{
    for j = 0; j < 10; j++
        {
            if board[i][j] == 1
            {
                break mainloop;
            }
            
        }
}